import React from "react";
import { Router, Route} from "dva/router";
import Home from "./routes/home";
import Query from "./routes/query";
import Detail from "./routes/detail";
import CacheRoute, { CacheSwitch } from "react-router-cache-route";
import QueryDetail from "./routes/queryDetail";
function RouterConfig({ history }) {
  return (
    <Router history={history}>
     <CacheSwitch>
        <CacheRoute exact path="/" component={Home} when="always" />
        <Route path="/home" component={Home} />
        <Route path="/query" component={Query} />
        <Route path="/detail" component={Detail} />
        <Route path="/querydetail" component={QueryDetail} />
      </CacheSwitch>
    </Router>
  );
}

export default RouterConfig;
